package com.tengfei.blogsystem.dao;

import com.tengfei.blogsystem.pojo.Images;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @version v1.0
 * @author} feige
 * @date 2021-10-23-10:51
 * @description
 */
public interface ImageDao extends JpaRepository<Images, String>, JpaSpecificationExecutor<Images> {

    @Modifying
    @Query(nativeQuery = true, value = "update `tb_images` set `state`='0' where `id`=?")
    int deleteImageByUpdateState(String imageId);
}
